package encodeTest;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Vector;

public class test{
	
	public static void main(String[] a) throws UnsupportedEncodingException{
//		String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><req type=\"set\" action=\"batch_grant_revoke\" sid=\"q_992939@pigim.zhongsou.com\"><auth aid=\"1\" oid=\"7_2021368\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2023102\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2021736\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2021668\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2022014\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2021882\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2021886\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2022443\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2022444\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2022537\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2023058\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2023059\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2023075\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2023087\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/><auth aid=\"1\" oid=\"7_2023088\" rids=\"2611,2781,2780,2779\" action=\"revoke\"/></req>";
//		String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><req type=\"set\" name=\"%E8%80%81%E8%99%8E%E7%9A%84%E5%B0%BE%E5%B7%B4%E7%A2%B0%E4%B8%8D%E5%BE%97\" action=\"addgrant\" sid=\"q_992939@pigim.zhongsou.com\"><obj oid=\"7_2021736\" name=\"page\" desc=\"\" type=\"1\"><auth name=\"%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90\" aid=\"1\" desc=\"%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90\" rids=\"2781\" type=\"1\"/></obj><obj oid=\"7_2021668\" name=\"page\" desc=\"\" type=\"1\"><auth name=\"%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90\" aid=\"1\" desc=\"%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90\" rids=\"2781\" type=\"1\"/></obj><obj oid=\"7_2022014\" name=\"page\" desc=\"\" type=\"1\"><auth name=\"%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90\" aid=\"1\" desc=\"%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90\" rids=\"2779\" type=\"1\"/></obj></req>";
		String s = "%7B%22widgetTitleAreaBean%22:%7B%22title%22:%22%E5%85%AC%E5%8F%B8%E6%90%9C%E7%B4%A2%E6%A1%86%22,%22icon%22:%22/icon/b2b2.gif%22,%22tstyle%22:%22%22%7D,%22widgetContentAreaBean%22:%7B%22outstyle%22:%22background:url(http://i0.zhongso.com/img/conbg_red.png)%20repeat-x%22,%22mtemplet%22:47,%22burl%22:%22%22,%22num%22:6,%22infotype%22:1,%22server%22:1,%22pr%22:%22%22,%22ct%22:%22%22,%22hs%22:%22no%22%7D,%22widgetMoreAreaBean%22:%7B%22ismore%22:%220%22%7D,%22portletId%22:0,%22portletType%22:47,%22url%22:%22zs_b2b_search%22,%22keyword%22:%22%22,%22widget108Bean%22:%7B%22scale%22:1,%22st%22:2,%22ot%22:0,%22lpid%22:2021046%7D%7D";
		try {
//			s = URLEncoder.encode(s, "UTF-8");
//			System.out.println(s);
//			s = URLDecoder.decode(s,"gbk");
//			System.out.println(s);
			
//			s = URLEncoder.encode(s,"GBK");
//			System.out.println(s);
			s = URLDecoder.decode(s,"UTF-8");
			System.out.println(s);
//			
//			s = URLEncoder.encode(s, "UTF-8");
//			System.out.println(s);
//
//			s = URLDecoder.decode(s,"GBK");
//			System.out.println(s);
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//		System.out.println(sdf.format(new Date(System.currentTimeMillis())));
		
//		String sS = "%E6%9C%8D%E5%8A%A1%E4%B8%9A";
//		//sS = URLEncoder.encode(ss,"UTF-8");
//		String b = URLDecoder.decode(ss, "UTF-8");
//		System.out.println(b);
	}
}

